package com.java.dao;

import com.java.domain.ActivityRecord;
import com.java.domain.event.ActivityRecordEvent;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;

/**
* @ClassName: ActivityRecordDao
* @Description: Database operations
* @author admin
* @date 2024-04-16
 */
public interface ActivityRecordDao {

	/**
	 * No conditional judgment
	 */
    int insert(ActivityRecord record);

	/**
	 * Conditional judgment
	 */
    int insertSelective(ActivityRecord record);

	/**
	 * Batch No conditional judgment
	 */
    int insertBatch(List<ActivityRecord> list);

	/**
	 * No conditional judgment
	 */
    int update(ActivityRecord record);

	/**
	 * Conditional judgment
	 */
    int updateSelective(ActivityRecord record);

	/**
	 * Delete information based on primary key
	 */
    int deleteByKey(String recordId);

	/**
	 * Delete information based on multiple primary keys
	 */
    int deleteByKeys(List<String> recordIds);

	/**
	 * Modify deletion, primary key/deleted field name
	 */
    int deleteUpdate(@Param("recordId")String recordId, @Param("delColumn")String delColumn);

	/**
	 * Modify deletion, multiple primary keys/deleted field names
	 */
    int deleteUpdates(@Param("recordIds")List<String> recordIds, @Param("delColumn")String delColumn);

	/**
	 * Obtain individual information based on primary key
	 */
    ActivityRecordEvent selectByKey(String recordId);

	/**
	 * Query list based on pagination
	 */
    List<ActivityRecordEvent> selectAll(@Param("record")Map<String, Object> record, @Param("pageOffset")int pageOffset, @Param("pageSize")int pageSize);

	/**
	 * Query list size
	 */
    long selectAllCount(@Param("record")Map<String, Object> record);
    
    /**
	 * No paginated query list
	 */
    default List<ActivityRecordEvent> selectAllNotPage(Map<String, Object> record) {
    	return selectAll(record, 0, 0);
    }
    
    ActivityRecordEvent selectByInfo(ActivityRecord info);
    
    List<ActivityRecordEvent> selectAllBySlot(@Param("sportId")String sportId, @Param("slotId")String slotId, @Param("dateStr")String dateStr);
    
    ActivityRecordEvent selectAllByUser(@Param("sportId")String sportId, @Param("slotId")String slotId, @Param("dateStr")String dateStr, @Param("userId")String userId);

	BigDecimal selectDateAmount(String dateStr);

}